﻿using System;
using System.Collections.Generic;
using NUnit.Framework;
using SimpleFS.Storage.SharePoint;

namespace SimpleFS.Specs.Providers.SharePoint
{
    [TestFixture]
    public class FileTest
    {
        protected File file;

        [SetUp]
        public void SetUp()
        {
            string fileName = "http://microsof-6wpex9:11381/hello/hello.txt";
            file = new File(fileName);
        }

        [Test]
        public void TestRead()
        {
            System.IO.Stream stream = file.Read();
        }

        [Test]
        public void TestWrite()
        {
            System.IO.FileStream stream 
                = new System.IO.FileStream(
                    "../../Resources/hello.txt", System.IO.FileMode.Open);
            this.file.Write(stream);

            Assert.IsTrue(this.file.Exists());
        }
    }
}
